﻿var DEMO = DEMO || {};

DEMO.index = {
	init : function() {
		var that = this;
		//刷新校验码
		that.changeImg();
		//点击登录
		that.login();
	},
	//刷新校验码
	changeImg : function() {
	    $('.a_img').on('click',function(){
	    	$(".security").attr("src","/showImg?random="+Math.random());
	    })
	},
	//点击登录
	login : function() {
		$('.login').on('click',function(){
			location.href = "/user/userList";
	    })
	}
}

//键盘enter键点击提交
function keyDown() {
	if(event.keyCode == 13){
		$('.login').trigger("click");
	}
	
}

$(function () {
	DEMO.index.init();
})